class Solution(object):
    def minMoves(self, nums, limit):
        ans = [0] * (2 * limit + 2)
        n = len(nums)
        for i in range(n // 2):
            min_num = min(nums[i], nums[n - 1 - i])
            max_num = max(nums[i], nums[n - 1 - i])
            ans[2] += 2
            ans[min_num + 1] -= 2
            ans[min_num + 1] += 1
            ans[min_num + max_num] -= 1
            ans[min_num + max_num + 1] += 1
            ans[max_num + limit + 1] -= 1
            ans[max_num + limit + 1] += 2
        for i in range(1, len(ans)):
            ans[i] += ans[i - 1]
        return min(ans[2: -1])

data = Solution()
nums = [1,2,4,3]
limit = 4
print(data.minMoves(nums, limit))